package com.wyp.didishige.utils;

public class NumberToCN {

    public static String[] chineseDigits = new String[] { "零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};

    /**
     * 把金额转换为汉字表示的数量，小数点后四舍五入保留两位
     * @param amount
     * @return
     */
    public static String amountToChinese(int amount) {
    	String chineseStr="";
    	if(amount>0&&amount<=10){
    		chineseStr=chineseDigits[amount]+"面";
    	}else if(amount>10&&amount<100){
    		int shi=amount/10;
    		int ge=amount%10;
    		if(ge==0){
    			chineseStr=chineseDigits[shi]+"面";
    		}else{
    			chineseStr=chineseDigits[shi]+"十"+chineseDigits[ge]+"面";
    		}
    	}else if(amount>=100&&amount<1000){
    		
    	}
        return chineseStr;

    }
    public static void main(String[] args) {
		System.out.println(amountToChinese(99));
	}
} 